package com.allqj.sfx.ddd.member.infrastructure.converter;

import com.allqj.sfx.ddd.member.domain.entity.admin.AdminUser;
import com.allqj.sfx.ddd.member.infrastructure.dao.AdminUserDAO;
import com.allqj.sfx.ddd.member.infrastructure.po.MemberAdminUserDO;
import com.allqj.sfx.infrastructure.converter.DataConverter;
import org.springframework.beans.BeanUtils;

/**
 * @author sjw
 * @className AdminUserDataConverter
 * @date 2022/7/20 15:37
 * @description: AdminUser&MemberAdminUserDO转换器
 */
public class AdminUserDataConverter implements DataConverter<AdminUser, MemberAdminUserDO, AdminUserDAO> {

    // 转换器实例
    public static AdminUserDataConverter INSTANCE = new AdminUserDataConverter();

    @Override
    public AdminUser do2Entity(MemberAdminUserDO memberAdminUserDO) {
        if (memberAdminUserDO == null)
            return null;
        AdminUser adminUser = new AdminUser();
        BeanUtils.copyProperties(memberAdminUserDO, adminUser);
        return adminUser;
    }

    @Override
    public MemberAdminUserDO entity2Do(AdminUser adminUser) {
        return null;
    }

    @Override
    public MemberAdminUserDO entity2Do(AdminUser adminUser, AdminUserDAO dao) {
        return null;
    }
}
